use wither::Model;

use crate::{
    mdb::{MClient, MDB},
    models::like_list::{LikeListContent, LikeListModel},
    AppResult, ArcConfig,
};
#[allow(unused)]
#[derive(Debug, Clone)]
pub struct LikeListService {
    mdb: MDB,
    m_client: MClient,
    config: ArcConfig,
}
impl LikeListService {
    pub fn new(mdb: MDB, m_client: MClient, config: ArcConfig) -> Self {
        Self {
            mdb,
            m_client,
            config,
        }
    }
    pub async fn save_like_content<C: Into<LikeListContent>>(
        &self,
        content: C,
    ) -> AppResult<LikeListModel> {
        let mut like_list = LikeListModel::new(content);
        like_list.save(&*self.mdb, None).await?;
        Ok(like_list)
    }
}
